package com.design.state;

/**
 * @author leali
 * @title: OnState
 * @projectName design
 * @description: 打开状态
 * @date 2021/12/31 22:05
 */
class OnState extends SwitchState {
    public void on(Switch s) {
        System.out.println("已经打开！");
    }

    public void off(Switch s) {
        System.out.println("关闭！");
        s.setState(Switch.getState("off"));
    }
}